﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class ChucNang_NguoiDung_NguoiDung_XemDanhMucSanPham : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        int maloai = int.Parse(Request.QueryString["MaPL"]);
        DataDSTableAdapters.PHANLOAITableAdapter PLadapter = new DataDSTableAdapters.PHANLOAITableAdapter();
        DataDS.PHANLOAIDataTable PLtable = PLadapter.PHANLOAI_LayPhanLoaiTheoIDCha(maloai);
        SiteMapLoaiSanPham1.Url = "/SMO/ChucNang/NguoiDung/NguoiDung_XemDanhMucSanPham.aspx";
        if(PLtable.Rows.Count > 0)
        {
            DataList_DanhMucSanPham.DataSource = PLtable;
            DataList_DanhMucSanPham.DataBind();
        }
        else
        {
            Response.Redirect("~/ChucNang/NguoiDung/NguoiDung_XemDanhSachSanPham.aspx?MaPL="+maloai);
        }
        

    }
}
